package com.su.dev.current;

import java.util.List;

import com.dev.su.bean.LinkBean;
import com.dev.su.db.DbConnector;
import com.dev.su.filter.URLMatcher;

public class SipderTask  extends BaseTask<String>{
    private String mIn;
    

    public SipderTask(String mIn) {
        this.mIn = mIn;
    }

    @Override
    protected String doInBackground(String in) {
        List<String> links = URLMatcher.getLinks(mIn);
        for (String string : links) {
            
            DbConnector dbConnector = new DbConnector();
            LinkBean bLinkBean = new LinkBean();
            bLinkBean.setmSourceUrl(string);
            bLinkBean.setmTime(System.currentTimeMillis());
            bLinkBean.setmTag(0);
            dbConnector.insertLinkBean(bLinkBean);
        }
        return null;
    }

    @Override
    protected String prepExcute() {
        return mIn;
    }

    @Override
    protected void postExcute(String result) {
        
    }

}
